/**
 * 
 */
package com.skku.selab.erp.job;

import java.sql.Connection;
import java.sql.ResultSet;

import com.skku.selab.erp.db.sql.DefaultQueries;

/**
 * @author June
 *
 */
public class schduler extends DefaultQueries {

	/**
	 * 
	 * CREATE
    [DEFINER = { user | CURRENT_USER }]
    EVENT
    [IF NOT EXISTS]
    event_name
    ON SCHEDULE schedule
    [ON COMPLETION [NOT] PRESERVE]
    [ENABLE | DISABLE | DISABLE ON SLAVE]
    [COMMENT 'comment']
    DO sql_statement;

schedule:
    AT timestamp [+ INTERVAL interval] ...
  | EVERY interval
    [STARTS timestamp [+ INTERVAL interval] ...]
    [ENDS timestamp [+ INTERVAL interval] ...]

interval:
    quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |
              WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |
              DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}

	 */
	public schduler() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * @param con :
	 * @param set :
	 * @return
	 */
	static public ResultSet setSchduler(Connection con, boolean set){
		ResultSet rs = null;
		if(set)
			rs = executeQuery(con, "set global event_scheduler = on");
		else
			rs = executeQuery(con, "set global event_scheduler = off");
		return rs;
	}
	
	/**
	 * @param con
	 * @param stmts
	 * @return
	 * 
	 */
	static public ResultSet createEvent(Connection con, String stmts){
		ResultSet rs = null;
		return rs;
	}
}
